package com.my.study.guava.retry;

import org.junit.Test;
import com.google.common.util.concurrent.Uninterruptibles;

import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;

/**
 * @author: yidujun
 * @create: 2021/07/20 11:27
 */
public class AttemptTimeLimiterTest {

    /**
     * @see Uninterruptibles#getUninterruptibly(Future, long, TimeUnit)
     */
    @Test
    public void test01() {
        try {
            int num = 10;

            while (true) {
                int val = num--;
                System.out.println(val);
                if (val == 7) {
                    return;
                }
            }
        } finally {
            System.out.println("========finally========");
        }

    }
}
